<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<%@include file="/pageRc/common/common.jsp"%>

<!DOCTYPE html>
<html lang="en" style="overflow-x: hidden">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
<meta name="format-detection" content="telephone=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<meta name="msapplication-tap-highlight" content="no">

<link rel="stylesheet"
	href="<%=commonPath %>/pageRc/layui/css/layui.css" media="all">
<script type="text/javascript"
	src="<%=commonPath %>/pageRc/js/jquery-1.9.1.min.js"></script> 
<script type="text/javascript"
	src="<%=commonPath %>/pageRc/common/utils.js"></script>
<script type="text/javascript"
	src="<%=commonPath %>/pageRc/common/msgTool.js"></script>
<script type="text/javascript"
	src="<%=commonPath %>/pageRc/layui/layui.js"></script>

<title>团队项目产能统计报表</title>

<script>
	$(function(){
	 
 	})
	//注意：选项卡 依赖 element 模块，否则无法进行功能性操作
	layui.use('element', function() {
		var element = layui.element();

		//…
	});
</script>

</head>
<body class="layui-main">
 <blockquote class="layui-elem-quote">
                  		团队项目产能统计报表
                     </blockquote>
	<div class="layui-form-item ">
		<form id="createMsgForm" name="createMsgForm" class="layui-form"
			action="">
			<div class="layui-form-item">
				<div class="layui-inline">
 					  
					<div class="layui-inline">
						   <button class="layui-btn" type="button" data-method="doSearchSum">查询</button>
						   
 					</div>
				</div>
			</div>
		 
		  
			<div class="layui-form-item" id="dateDiv">
				<div class="layui-inline">
					<table class="layui-table" lay-even="" lay-skin="line" style="text-align: center;">
						<colgroup>
							<col width="140">
							<col width="140">
							<col width="140">
							<col width="140">
							<col width="140">
						</colgroup>
						<thead>
							<tr>
								<th>团队名称</th>
								<th>项目组</th>
  								<th>总产能</th>
  								<th>填报产能</th>
  								<th>剩余产能</th>
								<th>用户数</th>
							</tr>
						</thead>
						<tbody id="detailDiv">

						</tbody>
						<script id="tplSrc" type="text/html">
							 {{#  layui.each(d.body, function(index, x){}}
							     <tr >
								   <td>{{x.proGroupName==undefined?'':x.proGroupName}}</td>
								   <td>{{x.proTeamName==undefined?'':x.proTeamName}}</td>
								   <td>{{x.needTime==undefined?'':x.needTime}}</td>
								   <td>{{x.capacityHour==undefined?'':x.capacityHour}}</td> 
								   <td>{{x.releasCap==undefined?'':x.releasCap}}</td> 
								   <td>{{x.userCnt==undefined?'':x.userCnt}}</td> 
 							    </tr>
							{{#  }); }} 
					   </script>
					</table>
				</div>
			</div> 
			<div class="layui-form-item">
				<div class="layui-inline">
					<div id="laypageDiv"></div>
				</div> 
			</div>
		</form>
	</div>
	<input id="bindStat" type="hidden" name="bindStat" value="">
	<input id="zhifuStat" type="hidden" name="zhifuStat" value="">
	<input id="sunRedio" type="hidden" name="sunRedio" value="0">
</body>
<script type="text/javascript">
var path="<%=commonPath%>";
var msg =new msgTool();
layui.use(
		[ 'form', 'layer', 'laytpl', 'laypage','laydate' ],
		function() {
			var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
	        var form = layui.form()
	            ,layer = layui.layer
	            ,laypage = layui.laypage
	            ,laytpl = layui.laytpl; 
			  
	        var active = {
	        		doSearchSum:function(){   //搜索
 			        			var getTpl = tplSrc.innerHTML;
		 						var dataObj = { }
										msg.sendMsg("/page/main/selectCapReportList.do",
														dataObj,
														function(data) {
															laytpl(getTpl).render(data,function(html) {
																 detailDiv.innerHTML = html;
																 });
														});
							},
							 doExcel:function() {
								 var dataObj = {
										"proGroupNo" : $("#proGroupNo").val(),
										"proTeamNo" : $("#proTeamNo").val(),
										"startDate":$("#startDate").val(),
										"endDate":$("#endDate").val(),
	 								} 		 
								 msg.sendMsg("/page/main/doExcelFile.do",dataObj,function(data){
					 			 	 	window.location.href = path +"/downFile/"+data.body.fileName
								 	});
							   }

						}
	        $('.layui-btn').on('click', function(){
	            var othis = $(this), method = othis.data('method');
	            active[method] ? active[method].call(this, othis) : '';
	          }); 	 
	        form.on('select(proGroupSelect)', function(data){
            	var groupNo = data.value; //得到被选中的值
            //	groupNo = encodeURIComponent(encodeURIComponent(groupNo));
            	$.ajax({
            		type:'POST',
            		url:'<%=commonPath %>/page/sys/'+groupNo+'/selectProTeamByGroupNo.do',
            		dataType:'JSON',
            		//data:'"groupNo="'+groupNo+'"',
            		success:function(data){
            			
            				$.each(data.body.teanList,function(key,val){
            					var option1 = $("<option>").val(val.proTeamNo).text(val.proTeamName);
            					$("#proTeamNo").append(option1);
            					form.render('select');
            				});
            				$("#proTeamNo").get(0).selectedindex=0;
            		}
            	})
            });
	  });
</script>
</html>